<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragrma","no-cache");
response.setDateHeader("Expires",0);
%>
<title>校园失物招领系统</title>
<style type="text/css">
	
</style>
<script type="text/javascript" src="./js/head.js"></script>
</head>
<body>
	<div id="user" style="width: 100%;height: 100%;" oncontextmenu="return false">
		<div class="header">
			<h3>板块管理</h3>
			<img src='img/logo.png'>
		</div>
		<!-- ===========================================================主页面  -->
		<div v-show="pageA">
			<!-- ==============================================================查询条件 -->
			<div class="mt10 ml10 mr10 border" style="padding: 10px;">
				<div class="hand w200">
					<i class="el-icon-caret-bottom lan">查询条件</i>
				</div>
				<div class="flex wBetween mt10">
					<div>
						<span class="mr10">板块名称</span>
						<el-input class='w200' v-model="pname" size="medium" clearable :maxlength='50'></el-input>
					</div>
					<div>
						<span class="mr10">板块描述</span>
						<el-input class='w200' v-model="pdescription" size="medium" clearable :maxlength='50'></el-input>
					</div>
					<div>
						<span class="mr10">创建时间</span>
						<el-date-picker
					      v-model="createDate"
					      type="daterange"
					      range-separator="至"
					      start-placeholder="开始日期"
					      end-placeholder="结束日期"
					      size="medium" clearable>
					    </el-date-picker>
					</div>
				</div>
				<div class="flex wCenter mt10"><el-button type="primary" size="mini" @click="query">查询</el-button></div>
			</div>
	
			<div class="mt20 ml10 mr10 border" style="padding: 10px;">
				<div class="hand w200">
					<i class="el-icon-caret-bottom lan">列表详情</i>
				</div>
				<!-- 列表展示 -->
				<div class="mt10">
					<el-table :data="tableData" stripe border :row-style="rowS" style="width: 100%;"  @selection-change="handleSelectionChange"><!-- -->
						<el-table-column type="selection" width="55"></el-table-column>
					    <el-table-column prop="pname" label="名称" head-align="center" align="center" sortable show-overflow-tooltip></el-table-column>
					    <el-table-column prop="pdescription" label="描述" head-align="center" align="center" sortable show-overflow-tooltip></el-table-column>
					    <el-table-column prop="user.userName" label="创建人" head-align="center" align="center" sortable show-overflow-tooltip></el-table-column>
					    <el-table-column prop="p_create_time" label="创建时间" :formatter="dateFormat" head-align="center" align="center" sortable show-overflow-tooltip></el-table-column>
					    <el-table-column prop="pstatus" label="状态" head-align="center" align="center" sortable show-overflow-tooltip>
					    	<template slot-scope="scope">
						        <span v-if="scope.row.pstatus==0">正常</span>
						        <span v-else="scope.row.pstatus!=0">{{pstatus}}</span>	        
						    </template>
					    </el-table-column>
					</el-table>
					
					<!-- bottons -->
					<div class="flex mt10">
						<el-button type="primary" size="mini" @click="add">新增</el-button>
						<el-button type="primary" size="mini" @click="update">修改</el-button>
						<el-button type="primary" size="mini" @click="del">删除</el-button>
					</div>
					
					<div class="flex wEnd mt10">
						<el-pagination @size-change="handleSizeChange"  @current-change="handleCurrentChange" :current-page="currPage"
					      :page-sizes="[10, 20, 30, 40]" :page-size="pageSize" :total="total"
					      layout="total, sizes, prev, pager, next, jumper">
		   				</el-pagination>
					</div>
					
				</div>
				
			</div>
		</div>		
		<!-- ===========================================================新增页面  -->
		<div v-show="pageB" class="p10">
			<div class="div_border p10" style="">
				<el-form class="mt10" :model="plate" :rules="plateRules" ref="plateRef" label-position="left" label-width="100px" style="width:70%;margin:0 auto;">
					<el-form-item label="板块名称" prop="pname">
					  <el-input v-model="plate.pname" clearable :maxlength='50'></el-input>
					</el-form-item>
					<el-input v-model="plate.pid" clearable v-show="false"></el-input>
					<el-form-item label="板块描述" prop="pdescription">
					  <el-input clearable v-model="plate.pdescription" :maxlength='50'></el-input>
					</el-form-item>
					<el-form-item label="板块状态" prop="pstatus">
					  <el-select v-model="plate.pstatus" clearable >
				  		<el-option
				          v-for="item in statusList"
				          :key="item.value"
				          :label="item.label"
				          :value="item.value">
				        </el-option>
					  </el-select>
					</el-form-item>
				<el-form>
				<div class="flex wCenter">
					<el-button type="primary" size="mini" @click="submit('plateRef')">提交</el-button>
					<el-button type="primary" size="mini" @click="back('plateRef')">返回</el-button>
				</div>
			</div>
		</div>
		<!-- ===========================================================详情  -->
	</div>
</body>
<script type="text/javascript" src="./js/plate.js"></script>
</html>